<?php
/**
 * @Author: rocky
 * Date: 2019/9/28
 * Time: 16:28
 */
namespace app\shop\resource;

use app\common\resource\BaseResource;

class GoodListResource extends BaseResource
{
    public function toArray($data){
        return [
            'id'=>$data['id'],
            'title'=>$data['title'],
            'price'=>$data['price'],
            'vip_price'=>$data['vip_price'],
            'logo'=>$data['logo'],
            'num' => $data['cart'][0]['num']?$data['cart'][0]['num']:0,
            'cate_id' => $data['cate_id']
        ];
    }
}